VERSION 5.00
Begin VB.Form frmMinSubClass 
   Caption         =   "Minimal Subclassing Sample"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   ClipControls    =   0   'False
   HasDC           =   0   'False
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
End
Attribute VB_Name = "frmMinSubClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'***************************************************************
' (c) Copyright 2000 Matthew J. Curland
'
' This file is from the CD-ROM accompanying the book:
' Advanced Visual Basic 6: Power Techniques for Everyday Programs
'   Author: Matthew Curland
'   Published by: Addison-Wesley, July 2000
'   ISBN: 0-201-70712-8
'   http://www.PowerVB.com
'***************************************************************
Option Explicit
Private m_SubClassMain As SubClassData
Private Sub Form_Load()
    SubClass m_SubClassMain, Me.hWnd, ObjPtr(Me), AddressOf RedirectMinSubClassWindowProc
End Sub
Private Sub Form_Unload(Cancel As Integer)
    UnSubClass m_SubClassMain, Me.hWnd
End Sub
Private Sub Form_Paint()
    CurrentX = 0
    CurrentY = 0
    Print "Watch window messages in the debug window."
End Sub
Friend Function WindowProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Debug.Print Hex$(uMsg)
    WindowProc = CallWindowProc(m_SubClassMain.wndprocNext, hWnd, uMsg, wParam, lParam)
End Function

